import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, UrlSegment } from '@angular/router';

@Component({
  selector: 'app-test',
  templateUrl: './test.component.html',
  styleUrls: ['./test.component.scss']
})
export class TestComponent implements OnInit {

  constructor(private route:ActivatedRoute) { }

  ngOnInit() {
    console.log('routeConfig', this.route.routeConfig)
    this.route.params.map((params => {
      console.log('params', params, params.id);
      return params.id;
    })).subscribe(()=> {})
    //console.log(this.route.url);
    //const url: Observable<string> = route.url.map(segments => segments.join(''));
    this.route.url.map(segments => segments.join('')).subscribe((urls) => {
      console.log('urls', urls);
      //console.log('urlSegment.length', urls.length);
      //for (let i = 0, j = urls.length; i < j; i++) {
      //  console.log('urlSegment.path', i, urls[i].path);
      //}
    })
  }

}
